package compiler;

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManagerFactory;

public final class PMF {
    private static PersistenceManagerFactory pmfInstance =
        JDOHelper.getPersistenceManagerFactory("transactions-optional");

    private PMF() {}

    public static PersistenceManagerFactory get() {
        return pmfInstance;
    }
    
    public static void close(){
    	pmfInstance.close();
    	if(pmfInstance.isClosed()){
    		pmfInstance = JDOHelper.getPersistenceManagerFactory("transactions-optional");
    	}
    }
}